#include "TestParticle.h"

TestParticle::TestParticle(Image* i):ParticleSystem(i)
{
	angle = 0;
}

TestParticle::~TestParticle(void)
{
}

void TestParticle::updateParticle(Particle* p)
{

	p->color.r += 5;
	if(p->life < 20)
	{
		p->width-=.51;
		p->height-=.51;
		p->color.a-=9;
	}else{
		p->width+=1;
		p->height+=1;
	}
}

void TestParticle::spawn()
{
	angle+=.5;
	float mult = 1.5;
	for(int x=-1; x<2; x+=2)
	{
		Particle* p = new Particle();

		p->xVel = x*3*cos(angle)*mult;
		p->yVel = x*3*sin(angle)*mult;
		p->color = Color(0,155,255,144);

		p->xPos = 0;
		p->yPos = 0;

		p->width = 40*mult;
		p->height = 40*mult;
		p->life = 45;

		addParticle(p);
	}

}